//
//  AlertaticsViewController.m
//  Alerta Tics
//
//  Created by Jose Miguel Alvarez on 10/27/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "AlertaticsViewController.h"

@implementation AlertaticsViewController

-(IBAction)CambiarPantalla
{
    LoginViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
    controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentModalViewController:controller animated:YES];
}
@synthesize locationManager;
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    //inicializamos el CLLocationManager
    self.locationManager = [[CLLocationManager alloc] init];
    
    self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    
    self.locationManager.distanceFilter = kCLDistanceFilterNone;
    
    if ([CLLocationManager locationServicesEnabled]) {
        self.locationManager.delegate = self;
        
        [self.locationManager startUpdatingLocation];
    }
}

-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
    /*agregar un sleep antes de guardar la posición para que sea precisa, sino muestra la ultima guardada por el iphone*/
    /*[self.location.Manager stopUpdatingLocation];*/
    
    latitud = newLocation.coordinate.latitude;
    longitud = newLocation.coordinate.longitude;
    
    
}

@end

